<? 
require_once '../includes/funciones.php';
include ("seguridad.php");
conexion();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulopanel(); ?></title>
<link rel="STYLESHEET" type="text/css" href="estilo.css"><link rel="shortcut icon" href="favicon.ico" />
<script type="text/javascript" src="../plugins/jquery.js"></script>
<script type="text/javascript" src="../plugins/jquery_validate/jquery.validate.js"></script>
<script type="text/javascript" src="../plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : 'exact',
    theme : 'advanced',
	elements: 'summary, conten',
    theme_advanced_buttons1 : 'bold,italic,underline,undo,redo',
    theme_advanced_buttons2 : '',
    theme_advanced_buttons3 : '',
    theme_advanced_toolbar_location : 'top',
    theme_advanced_toolbar_align : 'left',    
    init_instance_callback : "initialiseInstance"
});


$(document).ready(function() {
$("input[type='submit']").click(function() {
tinyMCE.triggerSave();
})
})
	
</script>

</head>

<body>


<div id="contenedor">

  	<div id="encabezado"><?php include('header.php') ?></div><!--fin de encabezado-->



	<div id="menuizquierda"><?php include('menu.php') ?></div>	<!--fin de menuizquierda-->

	<div id="content">


	<div id="formulario">

			<br>
			<?php


if(isset($_GET['var'])){
			
			$var=sqlint($_GET['var']);
			$result=mysql_query("select * from news where id=$var");

if(mysql_num_rows($result) !=0){
			while($row=mysql_fetch_array($result))
			{

			$impresos++; //me va aumentando por cada uno asi despues puedo usar para la PAGINACION

			$id_news=$row['id'];
			$title=cleanxss($row['title']);
			$summary=cleanxss($row['summary']);
			$content=cleanxss($row['content']);
			$categorie=$row['id_categories'];
			$published=$row['is_published'];
			$rowcategorie=existe("id", "categories", $categorie);
			

			}

			mysql_free_result($result);

}
else {
	$_SESSION["errorborrarnoticia"]="noexiste";
	header	("location: institucionales.php");
}

			
?>
		

	
<span class="title">Eliminar Institucional</span>
			
			<br>
			<br>
			
			<form class="admin" action="control_institucional.php" method="post">
			<fieldset class="admin">
			<legend >Noticia</legend>
						
			<p><span>
			Publicar:</span>
			
			<?php 
			if($published==1){
				echo '<input type="checkbox" name="published" value="1" checked /></input>';
				 
				}else{
					
				echo '<input type="checkbox" name="published" value="1" /></input>';		
				}
			
			
			?>
			
			</p>
			<input type="hidden" name="categorie" value="5">
			<br>
			<p><span>
			Titulo:</span>
			<input type="text" name="title" id="title" onkeyup="if (this.value.length == 139) this.disabled = true;" size="70px" value="<?php echo $title?>">
			</p>
			<br>
			<p><span>
			Resumen:</span>
			<textarea name="summary" cols="60" rows="5"><?php echo $summary?></textarea>
			</p>
			<br><br><br><br><br><br><br><br/>
			<p><span>
			Articulo:</span>
			<textarea name="conten" cols="60" rows="10"><?php echo $content?></textarea>
			<input name="boton" type="hidden" id="boton" value="3"></input>
			<input name="id_news" type="hidden" id="boton" value="<?php echo $id_news?>"></input>
			<br>
			
			
			</fieldset>
			<br>
			<input class="buttonadmin" type="submit" value="Borrar">
			<a class="enlacecancelar" href="institucionales.php"><input type="button" class="buttoncancelar" value="Cancelar"></a>
			<br>
			
			</form>
			<br>
			<br>


<?php 
} #Cierra el IF del isset($_GET['var'])

?>


		</div><!-- formulario -->

		</div><!--content-->


<div id="piepagina">

</div>
<!--fin de piepagina-->

</div><!-- contenedor -->


</body>

</html>
